package com.chartboost.sdk.impl;

import java.io.Serializable;
import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;
import java.net.NetworkInterface;
import java.nio.ByteBuffer;
import java.util.Enumeration;
import java.util.Random;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Level;
import java.util.logging.Logger;

public class ay
  implements Serializable, Comparable<ay>
{
  static final Logger a = Logger.getLogger("org.bson.ObjectId");
  private static AtomicInteger f = new AtomicInteger(new Random().nextInt());
  private static final int g;
  final int b;
  final int c;
  final int d;
  boolean e;

  static
  {
    try
    {
      localStringBuilder1 = new StringBuilder();
      Enumeration localEnumeration = NetworkInterface.getNetworkInterfaces();
      while (localEnumeration.hasMoreElements())
        localStringBuilder1.append(((NetworkInterface)localEnumeration.nextElement()).toString());
    }
    catch (Throwable localThrowable1)
    {
      StringBuilder localStringBuilder1;
      a.log(Level.WARNING, localThrowable1.getMessage(), localThrowable1);
      int i = new Random().nextInt() << 16;
      while (true)
      {
        a.fine("machine piece post: " + Integer.toHexString(i));
        int j = new Random().nextInt();
        try
        {
          int i1 = ManagementFactory.getRuntimeMXBean().getName().hashCode();
          k = i1;
          ClassLoader localClassLoader = ay.class.getClassLoader();
          if (localClassLoader != null)
          {
            m = System.identityHashCode(localClassLoader);
            StringBuilder localStringBuilder2 = new StringBuilder();
            localStringBuilder2.append(Integer.toHexString(k));
            localStringBuilder2.append(Integer.toHexString(m));
            int n = 0xFFFF & localStringBuilder2.toString().hashCode();
            a.fine("process piece: " + Integer.toHexString(n));
            g = n | i;
            a.fine("machine : " + Integer.toHexString(g));
            return;
            int i2 = localStringBuilder1.toString().hashCode();
            i = i2 << 16;
          }
        }
        catch (Throwable localThrowable2)
        {
          while (true)
          {
            int k = j;
            continue;
            int m = 0;
          }
        }
      }
    }
    catch (Exception localException)
    {
      throw new RuntimeException(localException);
    }
  }

  public ay()
  {
    this.b = ((int)(System.currentTimeMillis() / 1000L));
    this.c = g;
    this.d = f.getAndIncrement();
    this.e = true;
  }

  public ay(int paramInt1, int paramInt2, int paramInt3)
  {
    this.b = paramInt1;
    this.c = paramInt2;
    this.d = paramInt3;
    this.e = false;
  }

  public ay(String paramString)
  {
    this(paramString, false);
  }

  public ay(String paramString, boolean paramBoolean)
  {
    if (!a(paramString))
      throw new IllegalArgumentException("invalid ObjectId [" + paramString + "]");
    if (paramBoolean)
      paramString = b(paramString);
    byte[] arrayOfByte = new byte[12];
    for (int i = 0; i < arrayOfByte.length; i++)
      arrayOfByte[i] = ((byte)Integer.parseInt(paramString.substring(i * 2, 2 + i * 2), 16));
    ByteBuffer localByteBuffer = ByteBuffer.wrap(arrayOfByte);
    this.b = localByteBuffer.getInt();
    this.c = localByteBuffer.getInt();
    this.d = localByteBuffer.getInt();
    this.e = false;
  }

  public static ay a(Object paramObject)
  {
    if (paramObject == null)
      return null;
    if ((paramObject instanceof ay))
      return (ay)paramObject;
    if ((paramObject instanceof String))
    {
      String str = paramObject.toString();
      if (a(str))
        return new ay(str);
    }
    return null;
  }

  static String a(String paramString, int paramInt)
  {
    return paramString.substring(paramInt * 2, 2 + paramInt * 2);
  }

  public static boolean a(String paramString)
  {
    if (paramString == null);
    int i;
    do
    {
      return false;
      i = paramString.length();
    }
    while (i != 24);
    int j = 0;
    label19: if (j < i)
    {
      int k = paramString.charAt(j);
      if ((k >= 48) && (k <= 57));
      while (true)
      {
        j++;
        break label19;
        if ((k < 97) || (k > 102))
          if ((k < 65) || (k > 70))
            break;
      }
    }
    return true;
  }

  public static String b(String paramString)
  {
    if (!a(paramString))
      throw new IllegalArgumentException("invalid object id: " + paramString);
    StringBuilder localStringBuilder = new StringBuilder(24);
    for (int i = 7; i >= 0; i--)
      localStringBuilder.append(a(paramString, i));
    for (int j = 11; j >= 8; j--)
      localStringBuilder.append(a(paramString, j));
    return localStringBuilder.toString();
  }

  int a(int paramInt1, int paramInt2)
  {
    long l = (0xFFFFFFFF & paramInt1) - (0xFFFFFFFF & paramInt2);
    if (l < -2147483648L)
      return -2147483648;
    if (l > 2147483647L)
      return 2147483647;
    return (int)l;
  }

  public int a(ay paramay)
  {
    int i;
    if (paramay == null)
      i = -1;
    do
    {
      do
      {
        return i;
        i = a(this.b, paramay.b);
      }
      while (i != 0);
      i = a(this.c, paramay.c);
    }
    while (i != 0);
    return a(this.d, paramay.d);
  }

  public String a()
  {
    byte[] arrayOfByte = b();
    StringBuilder localStringBuilder = new StringBuilder(24);
    for (int i = 0; i < arrayOfByte.length; i++)
    {
      String str = Integer.toHexString(0xFF & arrayOfByte[i]);
      if (str.length() == 1)
        localStringBuilder.append("0");
      localStringBuilder.append(str);
    }
    return localStringBuilder.toString();
  }

  public byte[] b()
  {
    byte[] arrayOfByte = new byte[12];
    ByteBuffer localByteBuffer = ByteBuffer.wrap(arrayOfByte);
    localByteBuffer.putInt(this.b);
    localByteBuffer.putInt(this.c);
    localByteBuffer.putInt(this.d);
    return arrayOfByte;
  }

  public int c()
  {
    return this.b;
  }

  public int d()
  {
    return this.c;
  }

  public int e()
  {
    return this.d;
  }

  public boolean equals(Object paramObject)
  {
    if (this == paramObject);
    ay localay;
    do
    {
      return true;
      localay = a(paramObject);
      if (localay == null)
        return false;
    }
    while ((this.b == localay.b) && (this.c == localay.c) && (this.d == localay.d));
    return false;
  }

  public int hashCode()
  {
    return this.b + 111 * this.c + 17 * this.d;
  }

  public String toString()
  {
    return a();
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.chartboost.sdk.impl.ay
 * JD-Core Version:    0.6.2
 */